package com.hncc.dms.controller;

import com.hncc.dms.domain.vo.PatientBillsVo;
import com.hncc.dms.service.OutPatientService;
import com.hncc.pms.domain.PmsPatient;
import com.hncc.dms.domain.vo.PmsPatientVo;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.page.TableDataInfo;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author 荣陈
 * @date 2020/9/9 22:23
 */
@RestController
@RequestMapping("/dms/outPatient")
@Slf4j
public class OutPatientController extends BaseController {
    @Resource
    private OutPatientService outPatientService;

    @GetMapping("/getPatientBills")
    public TableDataInfo getPatientBills(PatientBillsVo patientBillsVo){
        startPage();
        List<PatientBillsVo> list=outPatientService.selectPatientBills(patientBillsVo.getRegistrationId());
        return getDataTable(list);
    }

    /**
     * 根据医生 状态 患者名获取患者信息
     * @param patientVo
     * @return
     */
    @GetMapping("/getPatientInfo")
    public TableDataInfo getPatientInfo(PmsPatientVo patientVo){
        log.info("信息:{}",patientVo.toString());
        startPage();
        List<PmsPatient> list = outPatientService.getPatientInfo(patientVo);
        return getDataTable(list);
    }
}
